package com.datasource.util;

import java.util.ArrayList;
import java.util.List;

public class EmailUtil {
  public static List<String> getRandomSuffix(int counts) {
    List<String> results = new ArrayList<>(counts);
    StringBuilder builder = new StringBuilder();
    String[] part = CharUtil.getRandomStrings(counts, 3, 6);
    for (int i = 0; i < counts; i++) {
      builder.delete(0, builder.length());
      builder.append("@").append(part[i]).append(".");
      results.add(builder.toString());
    }

    part = CharUtil.getRandomStrings(counts, 3, 6);
    for (int i = 0; i < counts; i++) {
      builder.delete(0, builder.length());
      builder.append(results.get(i)).append(part[i]);
      results.set(i, builder.toString());
    }

    return results;
  }
}
